# if _MSC_VER
# pragma warning(disable:4244)
# endif
+#if !defined _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_DEPRECATE 1
#endif
+#endif
/* Pathname separator character */
#if __WIN32__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <setupapi.h>
+// If hidsdi.h is not found, you need to download the Windows Driver Kit,
+// from http://www.microsoft.com/whdc/Devtools/wdk/default.mspx
+// You need to install 'build environments' and 'tools' from the SDK and
+// follow the instructions in the Install.html to get MSVC to find the right
+// headers and libraries.
#include <hidsdi.h>
static HANDLE hid_handle;
unsigned char crc, *data = NULL;
int cmdLen, j, bsize, i, len, ff_len, null_len, rc, init_scan, retry_cnt, log_enabled;
unsigned int line_size, data_size, data_addr, addr, addr_max;
- long dsize, dpos = 0;
+ unsigned long dsize, dpos = 0;
FILE *dout;
char *fusage = NULL;
}
}
fatal(MYNAME ": Too many read errors on serial port\n");
+ return -1;
}
static int
}
/* reads 32-bit "middle-endian" fields */
-static unsigned int me_read32(const void *p) {
+static unsigned int me_read32(const unsigned char *p) {
return ((unsigned)be_read16(p+2) << 16) | ((unsigned)be_read16(p));
}
int i, t, s, rc, got_bytes;
int read_at_once = MAX(atoi(opt_read_at_once), 1);
int sectors_read, multi_read_supported = 1;
- gbuint8 *buffer;
+ gbuint8 *buffer = NULL;
state_init(&st);
st.route_head = track;
track_add_wpt(track, wpt);
if(line.bas.common.tag != 'T')
{
+ waypoint *wpt2;
assert(line.bas.common.tag == 'C' || line.bas.common.tag == 'V');
- waypoint *wpt2 = waypt_dupe(wpt);
+ wpt2 = waypt_dupe(wpt);
if(line.bas.common.tag == 'V') // waypoint with voice recording?
{
char vox_file_name[sizeof(line.adv.vox)+5];